package joctave.toolbox.joctave.video;


import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
import java.util.Vector;

import javax.imageio.ImageIO;

import joctave.core.tokens.*;
import joctave.core.tokens.numbertokens.DoubleNumberToken;
import joctave.core.functions.ExternalFunction;
import joctave.core.interpreter.ErrorLogger;
import joctave.core.interpreter.GlobalValues;
import joctave.toolbox.joctave.matrix._private.Jama.EigenvalueDecomposition;

/**An external function for computing eigenvalues and eigenvectors of an array  */
public class VideoWriter extends ExternalFunction
{

	
	
	/**return a  matrix 
	* @param operands[0] = matrix 
	* @return matrix                                 */
	public OperandToken evaluate(Token[] operands, GlobalValues globals)
	{

	
		// one operand (e.g. eig(A) )
		if (getNArgIn(operands) !=1)
			throwMathLibException("VidoeReader: number of arguments !=1");

	    if (!(operands[0] instanceof CharToken)) 
        	throwMathLibException("VidoeReader: argument must be a string");

	    String filename = ((CharToken)operands[0]).toString();

	  
	   /* BufferedImage bitmap=null;
	    try {
	        bitmap = ImageIO.read(new File(filename));
	        
	    } catch (IOException e) {
	        throwMathLibException("iminfo: invalid file"+ System.getProperty("user.dir"));
	    }*/
	    MathLibObject obj=new MathLibObject();

	    /*obj.setField("Height",new DoubleNumberToken(biWidth));//bitmap.getHeight()));
	    obj.setField("Width",new DoubleNumberToken(biHeight));//bitmap.getWidth()));
	    obj.setField("FrameRate",new DoubleNumberToken(1/((float)dwMicroSecPerFrame/1000000.0f)));//bitmap.getWidth()));
	    obj.setField("NumberOfFrames",new DoubleNumberToken(dwTotalFrames));
	      */
        return obj;
		

	} // end eval
}

/*
@GROUP
image
@SYNTAX
iminfo(filename)
@DOC
information about an image
@NOTES
@EXAMPLES
<programlisting>
imfinfo('foo.png')
</programlisting>
@SEE
*/

